// component/menu/menu.js
const app=getApp()
Component({
  options: {
    addGlobalClass: true,
    multipleSlots: true
  },
  /**
   * 组件的属性列表
   */
  properties: {
    index: {
      type: String,
      value: 'info'
    },
    
  },

  /**
   * 组件的初始数据
   */
  data: {
   
  },

  /**
   * 组件的方法列表
   */
  methods: {
      fabu:function(e){
        let userInfo = app.globalData.userInfo
        console.log(userInfo)
        if (userInfo.role_id != 3) {
          wx.showToast({
            title: '管理员不能发布盘源',
            icon: 'none',
         
            success: function(res) {},
            fail: function(res) {},
            complete: function(res) {},
          })
          return
        }
        wx.redirectTo({
          url: '/pages/fabu/index',
        })
      },

      Me:function(e){
        let userInfo = app.globalData.userInfo
        console.log(userInfo)
        if (userInfo.role_id != 3) {
          wx.showToast({
            title: '管理员不能查看',
            icon: 'none',
            success: function (res) { },
            fail: function (res) { },
            complete: function (res) { },
          })
          return
        }
        wx.redirectTo({
          url: '/pages/mine/mine',
        })
      },
     Home:function(e){
      wx.redirectTo({
        url: '/pages/index/index',
      })
     },
     shuju:function(e){
       let userInfo = app.globalData.userInfo
       console.log(userInfo)
       if(userInfo.role_id!=3){
         wx.redirectTo({
           url: '/pages/data/data',
         })
       }else{
         wx.redirectTo({
           url: '/pages/data/mine/index',
         })
       }
     
   
     },
    toDetail:function(e){
      wx.redirectTo({
        url:'/pages/xiaoxi/index/index',
      })
    }

  }
})
